package com.aft.terra.modules.member.model;

import com.aft.terra.modules.member.model.base.BaseWechat;
import com.jfinal.kit.StrKit;

/**
 * 商城会员模型
 */
public class Wechat extends BaseWechat<Wechat> {
	
	/** 
	 * @Fields serialVersionUID: 
	 */
	  	
	private static final long serialVersionUID = -4246711497687108581L;
	
	public static final Wechat dao = new Wechat();
	
	/**
	 * 判断用户是否存在
	 * @author Mandarava
	 * @return
	 */
	public Boolean exists(){
		return StrKit.notBlank(getId()+"");
	}
	
	public Wechat findByOpenId(String openId){
		String sql = "select u.* from t_wechat u where u.openId = ?";
		Wechat user = findFirst(sql,openId);
		return user;
	}

}
